<option value="0" selected="selected">--请选择--</option>
<?php foreach ($categories as $k=>$v):?>
<option <?php if($k==$id):?>selected="selected"<?php endif;?>  value="<?php echo $k;?>"><?php echo $v;?></option>
<?php endforeach;?>
